package com.mapbased.wfw.bind;

import com.mapbased.wfw.*;
import javax.servlet.http.HttpSession;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: mapbased.com</p>
 *
 * @author chy(Baily)
 * @version 1.0
 */
public class SessionBinding
      extends AbstractBinding
{


      public SessionBinding(String exp)
      {
          super(exp);

    }

    /**
     * getValue
     *
     * @param context RenderContext
     * @return Object
     * @todo Implement this com.mapbased.wfw.Binding method
     */
    protected Object getDirectValue(RenderContext context)
    {
         HttpSession s=context.getRequest().getSession(false);
         if(s!=null)
         {
             return s.getAttribute(attributeName);
         }
         return null;
    }
}
